import urllib.request
# from urllib import request
#
# url = 'https://www.baidu.com/'
# # 模拟服务器发送请求
# response = urllib.request.urlopen(url)
# content = response.read().decode('utf-8')
# print(content)
#将爬取的数据保存在本地
#网页
url_page='https://www.baidu.com/'
urllib.request.urlretrieve(url_page,'baidu.html')
#图片
url_img='https://img-blog.csdnimg.cn/2021051521244130.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MzQ0Nzc3Ng==,size_16,color_FFFFFF,t_70'
urllib.request.urlretrieve(url_img,'lisa.jpg')
#视频
url_video='https://v6.huanqiucdn.cn/4394989evodtranscq1500012236/87f244201397757899455764506/v.f100830.mp4'
urllib.request.urlretrieve(url_video,'视频.mp4')